package com.lvan.consumer.receive;

import com.lvan.consumer.channel.MySink;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * @author luom
 * @date 2021/9/3
 * <p>
 * EnableBinding(Sink.class) 队列与交换机绑定
 */
@Component
@EnableBinding(MySink.class)
public class MessageConsumer {

    /**
     * 接收消息
     *
     * @param message 消息体
     */
    @StreamListener(MySink.MY_INPUT)
    public void receive(String message) {
        System.out.println("message = " + message);
    }
}
